package com.yjxxt.dao;

import com.yjxxt.empWithDept.empWithDept;
import com.yjxxt.vo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IDeptDao {
    public Dept selectByDeptno(int id);
    
    //登录
    public Dept selectByUsernameAndPasseord(@Param("username")   String username, @Param("password") int password);

    //分页
    public List<Dept> findByPage(@Param("currentPage") int currentPage,@Param("pageSize") int pageSize);

    public int insert(Dept dept);



    public int delete(int id);
    public int update(Dept dept);

    /**
     * 查找所有部门的名称和部门领导
     * @return 包含部门名称和领导的集合
     */
    public List<empWithDept> findAllDeptNamesAndManagers();

    public empWithDept findDeptWithMaxEmployeeCount();

    boolean addDepartmentWithManager(Dept dept);
    int updateEmployeeToManager(@Param("empno") int empno, @Param("deptno") String deptno);

}
